/**
 * 
 */
package it.battlehorse.scripting.registry;

import java.io.IOException;
import java.io.Reader;

/**
 * Defines a script
 * 
 * @author battlehorse
 */
public interface IScript {
	
	/**
	 * Returns the URI which points to the script source code, or {@code null} if the URI is not significant.
	 * 
	 * @return the URI which points to the script source code, or {@code null} if the URI is not significant.
	 */
	public String getURI();
	
	/**
	 * Returns the script extension 
	 * 
	 * @return the script extension 
	 */
	public String getExtension();
	
	/**
	 * Returns a Reader which points to the script source code 
	 * 
	 * @return a Reader which points to the script source code 
	 * @throws IOException if an I/O error occurs
	 */
	public Reader getReader() throws IOException;
	
	/**
	 * Returns the script unique id
	 * 
	 * @return the script unique id
	 */
	public String getId();
	
	/**
	 * Returns the namespace (i.e. plugin id) the scripts belongs to
	 * 
	 * @return the namespace (i.e. plugin id) the scripts belongs to
	 */
	public String getNamespace();
	
	/**
	 * Defines whether the script should be run in a modal context (for example, inside a progress monitor ) or not.
	 * @return whether the script should be run in a modal context (for example, inside a progress monitor ) or not.
	 */
	public boolean isModal();
}
